package com.zhn.evsi.client;

import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Request;
import com.dtflys.forest.annotation.Retry;
import com.dtflys.forest.annotation.Var;
import com.zhn.evsi.interceptor.TokenExceptionInterceptor;
import com.zhn.evsi.interceptor.TokenInterceptor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@BaseRequest(baseURL = "${eveData}${eveDataSns}", interceptor = TokenExceptionInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000")
public interface ContactClient {

    /**
     * 获取我的联系人列表
     * */
    // https://esi.evetech.net/latest/characters/2119634223/contacts/?datasource=tranquility&page=1&token=
    @Request(
            url = "/characters/{characters}/contacts/?datasource=tranquility&page={page}",
            type = "GET",
            interceptor = TokenInterceptor.class
    )
    List<JSONObject> contacts(@Var("characters") Integer characters, @Var("page") Integer page);
}
